<?php

class Specialization extends Article {

	var $id_specialization;
	var $title;
	var $description;
	
	/////////////////////////////////////////////////
	// Static member methods
	
	function Specialization($id_specialization = -1, $complete = false) {
		global $site;
		$this->_table_name = "articles";
		$this->_site = $site;
		$this->_object_type = "specialization";
		$this->_db = new mysqlconn(HOST,USER,PASS,DB);
		$this->_meta_fields = array();
		$this->_alias_fields = array("id_article" => "id_specialization", "title" => "title", "content" => "description");

		if ($id_specialization != -1) {
			$this->load($id_specialization);
		}
	}
	
	function create($title, $description) {
		$specialization = new Specialization();
		$specialization->title = $title;
		$specialization->description = $description;		
		return $specialization->save();
	}

	//////////////////////////////////////////////////////////////////////////////
	// Instance member methods
	
	function get_bookshops() {
		return $this->get_membresies_by_type("bookshop");
	}
	
	function count_bookshops() {
		$bookshops = $this->get_bookshops();
		return count($bookshops);
	}
	
	///////////////////////////////////////////////////////////////////////////////
	// Polymorphism methods
	function get_instance($id_instance) {
		return new Specialization($id_instance);
	}

	
}

?>